// 用户接口
import {
	getRequest,
	postRequest
} from '@/utils/http.ts'

// 用户登录
export const UserLogin = (data) => {
	return postRequest('/login', data)
}
// 退出登录
export const UserLogout = () => {
	return postRequest('/logout', {})
}

// 注册
export const UserRegist = (data) => {
	return postRequest('/user/regist', data)
}

// 用户信息
export const UserInfo = () => {
	return getRequest('/getInfo', {})
}

/** 查询客户消息 */
export const getUserMessage = () => {
	return getRequest('/wb/app/wbInform/getMessageList')
}

// 我的购买
export const UserNovels = () => {
	return getRequest('/system/novelItem/myNovels', {})
}

// 小说图片
export const BookDetails = (data) => {
	return getRequest('/system/novelItem/readPdf', data)
}

// 充值列表
export const rechargeList = (data) => {
	return getRequest('/system/bean/list', data)
}

// 发送验证码
export const toSendCode = (data) => {
	return postRequest('/user/toEmail/code', data)
}

// 发送验证码
export const getCrmUserInfo = (data) => {
	return getRequest('/user/getCrmUserInfo', data)
}

// 获取用户权限
export const getUserPower = () => {
	return getRequest('/wb/app/getInfo')
}

// 修改消息未读状态
export const changeUserStatus = (data) => {
	return getRequest(`/wb/app/wbInform/updateMessage?id=${data}`)
}

// 协议
export const getAgreements = (id) => getRequest('/wb/wbAgreements/' + id)

/**联系我们，服务协议*/
export const getMineCall = (data) => getRequest(`/wb/wbAgreements/list?title=${data}`)